<template>
    <div>
        <iframe
            src="http://frpt.gzmetro.com/webroot/decision/view/report?viewlet=ShiGong%252F%25E8%2587%25AA%25E5%25AE%259A%25E4%25B9%2589%25E6%258A%25A5%25E8%25A1%25A8%252F11-SG-UDPLAN_A1.cpt"
            frameborder="0" 
           
        ></iframe>
    </div>
</template>

<script setup>
import { ref, onActivated, onDeactivated } from 'vue'

// 通过 CSS 控制 iframe 显隐
// const iframeStyle = ref({
//   visibility: 'visible',
//   position: 'absolute'
// })


// 激活时恢复显示
onActivated(() => {
    console.log("active")
    // iframeStyle.value.visibility = 'hidden'
})

// 非激活时隐藏而非销毁
onDeactivated(() => {
    console.log("deactive")
    // iframeStyle.value.visibility = 'visible'  
})

</script>

<style lang="less" scoped>
div {
    height: 99%;
    width: 100%;
    position: relative;
    iframe {
        height: 100%;
        width: 100%;
    }
}
</style>